home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 June: Reference Library / Dev.CD Jun 96 RL / Dev.CD Jun 96 RL.toast / Technical Documentation / develop / develop Issue 26 / develop Issue 26 code / Wide (64 bit) Library / Wide Library source / Wide.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-25  |  4.0 KB  |  193 lines  |  [TEXT/KAHL]

  1. /**********************************************************
  2.  
  3.     Wide.h
  4.  
  5.     Author:
  6.         Dale Semchishen, 1996
  7.  
  8.     Description:
  9.         Function Prototypes for the Wide library
  10.  
  11.         If this library is built without the QuickDraw GX
  12.         includes on a 680x0 then all routines will be linked in.
  13.  
  14.         If this library is built with QuickDraw GX on a 680x0
  15.         then only WideInit(), WideAssign32(), WideAdd32(),
  16.         WideSub32(), WideToDecStr() and WideBitShift() will
  17.         be linked in. The other Wide routines are supported
  18.         by QuickDraw GX.
  19.  
  20.         To build this library for a QuickDraw GX environment
  21.         include the file <GXTypes.h> or <GXMath.h> before "Wide.h"
  22.  
  23.  **********************************************************/
  24.  
  25. #ifndef __WIDE__
  26. #define __WIDE__
  27.  
  28. #ifndef __TYPES__
  29. #include <Types.h>
  30. #endif
  31.  
  32.  
  33. /* IF generating code for 680x0 CPUs --------------------*/
  34. #if GENERATING68K
  35.  
  36. #ifndef __SANE__
  37. #include <SANE.h>
  38. #endif
  39.  
  40. /* IF compiling with MetroWorks, map SANE decimal type because 
  41.    they don't follow the name defined in PowerPC Numerics */
  42. #ifdef __MWERKS__
  43. typedef Decimal decimal;
  44. #endif
  45.  
  46. /* IF Quickdraw GX return values have not been defined */
  47. #ifndef __GXMATH__
  48. #ifndef __cplusplus
  49. #define fixed Fixed
  50. #endif
  51. #define gxPositiveInfinity ((Fixed) 0x7FFFFFFFL)
  52. #define gxNegativeInfinity ((Fixed) 0x80000000L)
  53. #endif
  54.  
  55. /* ELSE generating code for PowerPC ---------------------*/
  56. #else
  57.  
  58. #ifndef __FP__
  59. #include <fp.h>
  60. #endif
  61.  
  62. /* IF Quickdraw GX return values have not been defined */
  63. #ifndef __GXMATH__
  64. #define gxPositiveInfinity ((long) 0x7FFFFFFFL)
  65. #define gxNegativeInfinity ((long) 0x80000000L)
  66. #endif
  67.  
  68. #endif
  69.  
  70.  
  71. #ifdef __cplusplus
  72. extern "C" {
  73. #endif
  74.  
  75.  
  76.  
  77. /*------------------ Function Prototypes ------------------*/
  78.  
  79. void WideInit( void );
  80.  
  81. wide *WideAssign32
  82. (
  83.     wide    *target_ptr,        /* out: 64 bits to be assigned */
  84.     long          value            /* in:  assignment value */
  85. );
  86.  
  87. wide *WideAdd32
  88. (
  89.     wide    *target_ptr,        /* out: 64 bits to be added to */
  90.     long     value              /* in:  addition value */
  91. );
  92.  
  93. wide *WideSubtract32
  94. (
  95.     wide    *target_ptr,        /* out: 64 bits to be subtracted from */
  96.     long     value                /* in:  subtraction value */
  97. );
  98.  
  99. void WideToDecStr
  100. (
  101.         decimal *decstr_ptr,    /* out: decimal output string */
  102.     const wide  *source_ptr        /* in:  64 bit int to convert */
  103. );
  104.  
  105.  
  106. /* IF QuickDraw GX is not included */
  107. #ifndef __GXMATH__
  108.  
  109. short WideScale
  110. (
  111.     const wide  *bigint_ptr        /* in: 64 bits */
  112. );
  113.  
  114. #endif
  115.  
  116.  
  117. /* IF generating code for 680x0 CPUs */
  118. #if GENERATING68K
  119.  
  120. wide *WideBitShift
  121. (
  122.     wide    *target_ptr,        /* in/out: 64 bits to be shifted */
  123.     short       amount            /* in:     shift amount (+ right, - left) */
  124. );
  125.  
  126.  
  127. /* IF QuickDraw GX is not included */
  128. #ifndef __GXMATH__
  129.  
  130. wide *WideAdd
  131. (
  132.           wide  *target_ptr,    /* out: 64 bits to be added to */
  133.     const wide  *source_ptr        /* in:  addition value */
  134. );
  135.  
  136. short WideCompare
  137. (
  138.     const wide    *target_ptr,    /* in: first value */
  139.     const wide    *source_ptr        /* in: second value */
  140. );
  141.  
  142. long WideDivide
  143. (
  144.     const wide *dividend_ptr,    /* in:  64 bits to be divided */
  145.     long        divisor,        /* in:  value to divide by */
  146.     long       *remainder_ptr    /* out: the remainder of the division */
  147. );
  148.  
  149. wide *WideWideDivide
  150. (
  151.     wide    *dividend_ptr,        /* in/out:  64 bits to be divided */
  152.     long    divisor,            /* in:      value to divide by */
  153.     long   *remainder_ptr        /* out:     the remainder of the division */
  154. );
  155.  
  156. wide *WideMultiply
  157. (
  158.     long    multiplicand,        /* in:  first value to multiply */
  159.     long    multiplier,            /* in:  second value to multiply */
  160.     wide   *target_ptr            /* out: 64 bits to be assigned */
  161. );
  162.  
  163. wide *WideNegate
  164. (
  165.     wide    *target_ptr            /* in/out: 64 bit integer to be negated */
  166. );
  167.  
  168. wide *WideShift
  169. (
  170.     wide    *target_ptr,        /* in/out: 64 bits to be shifted */
  171.     short       amount          /* in:     shift amount (+ right, - left) */
  172. );
  173.  
  174. unsigned long WideSquareRoot
  175. (
  176.     const wide  *source_ptr        /* in:  value to take the square root of */
  177. );
  178.  
  179. wide *WideSubtract
  180. (
  181.           wide  *target_ptr,    /* out: 64 bit int to be subtracted from */
  182.     const wide  *bigint2_ptr    /* in:  subtraction value */
  183. );
  184.  
  185. #endif
  186.  
  187. #endif
  188.  
  189. #ifdef __cplusplus
  190. }
  191. #endif
  192.  
  193. #endif